#encoding:utf8
import hmac
import hashlib
import binascii
import base64

domain = ""

uwsgiConfig = """
[uwsgi]
module = wsgi
master = true
processes = 5
socket = %s.sock
chmod-socket = 660
gid = nginx
py-autoreload = 1
""" % (domain)

# 使用py-autoreload = 1是为了能够方便的改变文件后就能够重启uwsgi


multiStr = "a=200001&b=newbucket&k=AKIDUfLUEUigQiXqm7CVSspKJnuaiIKtxqAv&e=1437995704&t=1437995644&r=2081660421&f="
key = "bLcPnl88WU30VY57ipRhSePfPdOfSruK"
sha1_hmac = hmac.new(key,multiStr,hashlib.sha1)
digest = sha1_hmac.hexdigest()
digest = binascii.unhexlify(digest)
sign_hex = digest + multiStr
print base64.b64encode(sign_hex)
